import Router from 'vue-router'

// 导入对应的路由组件
import Home from './components/tabbar/Home.vue'
import Member from './components/tabbar/Member.vue'
import Shopcar from './components/tabbar/Shopcar.vue'
import Search from './components/tabbar/Search.vue'
import newList from './components/news/newList.vue'
import newInfo from './components/news/newInfo.vue'
import photoList from './components/photos/photoList.vue'
import photoInfo from './components/photos/photoInfo.vue'
import goodsList from './components/goodslist/goodList.vue'
import goodsInfo from './components/goodslist/goodsInfo.vue'
import goodsComment from './components/goodslist/goodsComment.vue'
import goodsDesc from './components/goodslist/goodDesc.vue'

var router = new Router({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/home', component: Home },
    { path: '/member', component: Member },
    { path: '/shopcar', component: Shopcar },
    { path: '/search', component: Search },
    { path: '/home/newList', component: newList },
    { path: '/home/newInfo/:id', component: newInfo },
    { path: '/home/photoList', component: photoList },
    { path: '/home/photoInfo:id', component: photoInfo },
    { path: '/home/goodsList', component: goodsList },
    // { path: '/home/goodsInfo/:id', component: goodsInfo, name: 'goodsInfo' }
    { path: '/home/goodsInfo', component: goodsInfo },
    { path: '/home/goodsDesc', component: goodsDesc },
    { path: '/home/goodsComment', component: goodsComment }
  ],
  linkActiveClass: 'mui-active', // 覆盖默认的路由高亮的类 默认的类是 router-link-active
  mode: 'history'
})

export default router
